#include "stdio.h"
#include "../section_locate.h"

#include "pt-thread.h"
#include "ringbuffer.h"

void pt_ringbuf_test(void);

static char name[30] = "pt_ringbuf_test";
struct func_pack sec_pt_ringbuf_test __attribute__ ( ( section ( "func_area" ) ) ) = {
    .func_addr = pt_ringbuf_test,
	.name_str = (uint32_t *)&name,
};

void pt_ringbuf_test(void)
{


//    uint8_t ch;
//    pt_ringbuffer_getchar(&test_rb, &ch);

//    uint8_t ch = 0x31;
//    for(int i = 0; i < 20; i++){
//        pt_ringbuffer_putchar_force(&test_rb, ch);
//        ch++;
//    }
//
//    for(int i = 0; i < 20; i++){
//        if(pt_ringbuffer_getchar(&test_rb, &ch) > 0){
//            printf("ch=%c\n", ch);
//        }
//
//    }
    struct pt_ringbuffer *test_rb;
    test_rb = pt_ringbuffer_create(8);
    uint8_t data[] = "asfut";
    pt_ringbuffer_put_force(test_rb, data, sizeof(data) );

    uint8_t get_data[8];
    pt_ringbuffer_get(test_rb, get_data, sizeof(get_data) );
    printf("get_data : %s\n", get_data);

}



